/*********************************************************************
** Copyright (c) 1998 MaK Technologies, Inc.
** All rights reserved.
*********************************************************************/
/*********************************************************************
** $RCSfile: makRti.h,v $ $Revision: 1.10 $ $State: Exp $
*********************************************************************/

// This file contains extensions to the standard RTI interface
// that are supported by the MAK RTI.

#ifdef DtIFSPEC1516
#include "RTI/RTI1516.h"
#else
#include "RTI.hh"
#endif

// Dynamically set the RTI notify level
// 0 - Fatal, 1 - Warning, 2 - Info, 3 - Verbose, 4+ - Debug
#ifdef DtIFSPEC1516
void RTI_EXPORT setRtiNotifyLevel(rti1516::RTIambassador* amb, int level);
#else
void RTI_EXPORT setRtiNotifyLevel(RTI::RTIambassador* amb, int level);
#endif

// Depreciated: Only for best effort
// Returns a file descriptor on which data will be present whenever
// there is incoming data waiting to be read by the RTI.  This can be 
// used in a call to select to avoid calling RTI::tick until there
// is actually data waiting.  Returns -1 if no such file descriptor.  
#ifdef DtIFSPEC1516
int RTI_EXPORT DtReadFileDescriptor(rti1516::RTIambassador* amb);
#else
int RTI_EXPORT DtReadFileDescriptor(RTI::RTIambassador* amb);
#endif

// Returns a file descriptor on which data will be present for the given
// transport type whenever there is incoming data waiting to be read by the RTI.  This can be 
// The file descriptors can be used in a call to select to avoid
// calling RTI::tick until there is actually data waiting.
// Returns -1 if no such file descriptor.  
//
// (Note: when running in asynchronous mode (RTI_asynchronousIO = 1)
// this function will return -1 on windows, use DtReadFileEvent instead.  
// On unix it will return the file descriptor of the pipe used for 
// inter-thread communication instead of the socket file descriptor.)
#ifdef DtIFSPEC1516
int RTI_EXPORT DtReadFileDescriptor(rti1516::RTIambassador* amb,
   rti1516::TransportationType transport);
#else
int RTI_EXPORT DtReadFileDescriptor(RTI::RTIambassador* amb,
   RTI::TransportType transport);
#endif


#if defined(_WIN32)
// Returns a WIN32 event handle that signals when data is present for
// the given transport type.  It can be used in calls such as 
// WaitForSingleObject to avoid calling RTI::Tick until there is 
// data waiting. When operating synchronously the event returned
// is based upon the socket specified by transport.  In asynchronous
// mode it returns the event used for inter-thread signalling
// regardless of the transport type.
#include "winsock2.h"
#ifdef DtIFSPEC1516
WSAEVENT RTI_EXPORT DtReadFileEvent(rti1516::RTIambassador* amb,
   rti1516::TransportationType transport);
#else
WSAEVENT RTI_EXPORT DtReadFileEvent(RTI::RTIambassador* amb,
   RTI::TransportType transport);
#endif

#endif
